{% extends "base.html" %}
{# Copyright The IETF Trust 2015-2021, All Rights Reserved #}
{% load origin static %}
{% block pagehead %}
    <link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block title %}Concluded groups{% endblock %}
{% block content %}
    {% origin %}
    <h1>Concluded groups</h1>
    <p class="alert alert-info my-3">
        Note that the information on historical groups may be inaccurate.
    </p>
    {% for label, groups in sections.items %}
        <h2 class="mt-5" id="{{ label|slugify }}">{{ label }}</h2>
        {% if label == "WGs" %}
        {% elif label == "RGs" %}
            <p class="alert alert-info my-3">
                The information below is incomplete and misses a few older RGs.
                Please check the
                <a href="https://irtf.org/groups">IRTF site</a>
                for more complete information.
            </p>
        {% endif %}
        {% if not groups %}
            <p class="alert alert-info my-3">
                No groups found.
            </p>
        {% else %}
            {% regroup groups by parent as grouped_by_areas %}
            {% for area_grouping in grouped_by_areas %}
                {% if area_grouping.grouper %}
                    <h3 class="mt-3"
                        id="{{ label }}-{{ area_grouping.grouper.name|default:'unknown'|slugify }}">
                        {{ area_grouping.grouper.name|default:'Unknown area' }}
                    </h3>
                {% endif %}
                <table class="table table-sm table-striped tablesorter">
                    <thead>
                        <tr>
                            <th scope="col" data-sort="group">Group</th>
                            <th scope="col" data-sort="name">Name</th>
                            <th scope="col" data-sort="date-start">Start</th>
                            <th scope="col" data-sort="date-concluded">Concluded</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for g in area_grouping.list %}
                            <tr>
                                <td>
                                    <a href="{{ g.about_url }}">{{ g.acronym }}</a>
                                </td>
                                <td>{{ g.name }}</td>
                                <td data-sort-number="{{ g.start_date|date:"U" }}">{{ g.start_date|date:"Y-m" }}</td>
                                <td data-sort-number="{{ g.conclude_date|date:"U" }}">{{ g.conclude_date|date:"Y-m" }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            {% endfor %}
        {% endif %}
    {% endfor %}
{% endblock %}
{% block js %}
    <script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}